/**
 * 工厂函数 其实就是一个高级函数，
 */
{
  const TimeDec = (time: number): MethodDecorator => {
    return (target, propertyKey, descriptor: PropertyDescriptor) => {
      let oldFun = descriptor.value;
      let timeLimit = null;
      descriptor.value = function (...args:[]) {
        setTimeout(() => {
            if(time){
                clearTimeout(timeLimit)
            }
            oldFun.apply(this,args)
        }, time * 1000);
      };
    };
  };

}
